<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo ($title); ?></title>
    <meta name="keywords" content="<?php echo ($title); ?>">
    <meta name="description" content="<?php echo ($title); ?>">
    <link href="/Public/static/admin/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/Public/static/admin/css/font-awesome.min93e3.css" rel="stylesheet">
    <link href="/Public/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/static/admin/css/style.min.css" rel="stylesheet">
    <style type="text/css">
        .img-thumbnail{
            width: 90px;
            height: 70px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>品牌表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-2">
                            <div class="input-group">
                                <a href="<?php echo U('add');?>" class="btn btn-outline btn-primary ">添加品牌</a>
                            </div>
                        </div>
                        <form name="brand_list" id="brand_list" action="index" method="post">
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" name="word" id="word" value="<?php echo ($word); ?>">
                                <span class="input-group-btn">
                                    <button type="submit" class="btn btn-sm btn-primary">搜 索</button>
                                </span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="hr-line-dashed" style="margin: 10px"></div>
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>品牌名</th>
                                <th>品牌图标</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="list_content">
                            <?php if(is_array($brand_list)): $i = 0; $__LIST__ = $brand_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
                                    <td><?php echo ($v["id"]); ?></td>
                                    <td><?php echo ($v["brand_name"]); ?></td>
                                    <td>
                                        <?php if(empty($$v["litimg"])): ?><img alt="image" class="img-thumbnail" src="/Public/static/admin/img/a4.jpg">
                                            <?php else: ?>
                                            <img alt="image" class="img-thumbnail" src="<?php echo ($v["litimg"]); ?>"><?php endif; ?>
                                    </td>
                                    <td><a href="javascript:;" class="btn btn-primary btn-xs" onclick="edit(<?php echo ($v["id"]); ?>)"><i class="fa fa-edit"></i> 编 辑</a> &nbsp;&nbsp;<a href="javascript:;" class="btn btn-danger btn-xs" onclick="del(<?php echo ($v["id"]); ?>)"><i class="fa fa-trash-o"></i> 删 除</a></td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                        <?php echo ($page); ?>
                        <div id="listpage"></div>
                    </div>
                    <div class="spiner-example">
                        <div class="sk-spinner sk-spinner-three-bounce">
                            <div class="sk-bounce1"></div>
                            <div class="sk-bounce2"></div>
                            <div class="sk-bounce3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/static/admin/js/jquery.min.js"></script>
<script src="/Public/static/admin/js/bootstrap.min.js"></script>
<script src="/Public/static/admin/js/plugins/layer/layer.min.js"></script>
<script src="/Public/static/admin/js/plugins/laypage/laypage.js"></script>
<script src="/Public/static/admin/js/plugins/laytpl/laytpl.js"></script>
<script src="/Public/static/admin/js/common.js"></script>
<script>
    //修改
    function edit(id){
        location.href = '/admin/brand/edit/id/'+id+'.html';
    }

    //删除
    function del(id){
        sxshop.del(id,"<?php echo U('del');?>","<?php echo U();?>")
    }
</script>
</body>
</html>